package com.purang.mathtest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    //        KLineView chartView;
    List<String> xValues;   //x轴数据集合
    List<Integer> yValues;  //y轴数据集合

    private String[] mWeekItems = new String[]{"09:32", "13:26", "13:28", "16:07", "16:57", "19:23", "20:55", "21:55", "22:55", "23:15", "22:55", "23:15"};
    private float[] mWeekPoints = new float[]{0.1f, 1f, 0.3f, 0.7f, 0.2f, 0.6f, 0.1f, 0.5f, 0.5f, 0.3f, 0f, 1f};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        chartView = (KLineView) findViewById(R.id.linechartview);
        CooGridView gridView = (CooGridView) findViewById(R.id.gridView);
        xValues = new ArrayList<>();
        yValues = new ArrayList<>();

        ArrayList<LineChartData> list = new ArrayList<>();

        for (int i = 0; i < mWeekItems.length; i++) {
            LineChartData data = new LineChartData();
            data.setItem(mWeekItems[i]);
            data.setPoint(mWeekPoints[i]);
            list.add(data);
        }

        // xy轴集合自己添加数据
        gridView.setData(list);

//        // xy轴集合自己添加数据
//        chartView.setXValues(xValues);
//        chartView.setYValues(yValues);

    }
}
